home *** CD-ROM | disk | FTP | other *** search
- /* âhü[âiâcî^âèâôâOùpéuéqélékâfü[â^ì∞ɼâvâìâOâëâÇ */
- #include <stdio.h>
- #include <math.h>
-
- int ply1=24,ply2=24,i;
- double rd=6.,prd=5.,pai=3.14,x,y,z;
- FILE *out;
- void vrml(void);
-
- void main(void){
- printf("è╟é╠ï▀ÄùüiéSê╚ÅπüjüH ");
- scanf("%d",&ply1);
- printf("è┬é╠ï▀ÄùüiéSê╚ÅπüjüH ");
- scanf("%d",&ply2);
- printf("è┬é╠ö╝îaüiéQê╚ÅπüjüH ");
- scanf("%lf",&prd);
- rd=prd-1;
- vrml();
- }
-
- void vrml(){
- out=fopen("list3-12-smpl.txt","w");
-
- /* crossSectioné╠îvÄZèJÄn */
- fprintf(out,"crossSectioné╠âfü[â^ü@ü@");
- fprintf(out,"x z\n");
- for(i=0;i<=ply1-1;i++){
- x=cos(i*(2*pai/ply1));
- z=sin(i*(2*pai/ply1));
- fprintf(out,"%26.3f %6.3f, \n",x,z);
- }
- fprintf(out,"%26.3f %6.3f \n\n",1.,0.);
- /* crossSectioné╠îvÄZÅIù╣ */
-
- /* spineé╠îvÄZèJÄn */
- fprintf(out,"spineé╠âfü[â^ ");
- fprintf(out,"x y z\n");
- for(i=0;i<=ply2-1;i++){
- x=rd*cos(i*(2*pai/ply2));
- y=rd*sin(i*(2*pai/ply2));
- z=0.;
- fprintf(out,"%26.3f %6.3f %6.3f, \n",x,y,z);
- }
- fprintf(out,"%26.3f %6.3f %6.3f \n",rd,0.,0.);
- /* spineé╠îvÄZÅIù╣ */
-
- fclose(out);
- }
-